#! /bin/sh

# --- Example shell for refRealVTI.c
# --- real reflection coefficients
# --- for VTI media or symmetry planes
# --- of HTI media or a combination of
# --- those.

# --- Input parameters are Thomsen parameters
# --- (i.e., anisotropy parameters defined 
# --- with respect to the symmetry axis)
# 
# --- Andreas Rueger, CWP Feb21, 1997

# ---- "isotropic" parameters
# ---- (shale/sand) interface

vp1=3.30 vs1=1.70 rho1=2.35
vp2=4.20 vs2=2.70 rho2=2.49 

# Thomsens anisotropy parameters
# Shale:
eps1=0.133 delta1=0.12

# Sand
eps2=0.0 delta2=0.0

# Shale has VTI symmetry
axis1=0 axis2=0


# Compute P-P reflection coeff.
modei=0 modet=0 rort=1

#incident angles
fangle=0 langle=40 dangle=1

# output format
iscale=0 ibin=1 


# outpar files
outpar1=outpar1 outpar2=outpar2

# coefficient files
coeffile1=coeff1.bin coeffile2=coeff2.bin

# Path to executables
#B=${HOME}/Release/bin

## plotting parameters -cosmetics
width=500       height=500
d1num=          d2num=
marksize=0 style=normal linewidth=3
label1="Incidence angle (degree)" label2="Reflection coefficient" 

# reflection coefficients ignoring anisotropy
refRealVTI  modei=$modei modet=$modet rort=$rort \
	fangle=$fangle langle=$langle dangle=$dangle \
	iscale=$iscale ibin=$ibin \
	outparfile=$outpar1 coeffile=$coeffile1 \
	vp1=$vp1 vs1=$vs1 rho1=$rho1 \
	delta1=0 eps1=0 axis1=$axis1 \
	vp2=$vp2 vs2=$vs2 rho2=$rho2 \
	delta2=0 eps2=0 axis2=$axis2 

n1=`cat $outpar1`

xgraph <$coeffile1 n=$n1 linecolor=2 \
        width=$width height=$height \
        d1num=$d1num d2num=$d2num\
        linewidth=$linewidth marksize=$marksize \
        label1=$label1 label2=$label2 \
        style=$style title="Ignoring Anisotropy" &


# reflection coefficients honoring the anisotropy

refRealVTI  modei=$modei modet=$modet rort=$rort \
	fangle=$fangle langle=$langle dangle=$dangle \
	iscale=$iscale ibin=$ibin \
	outparfile=$outpar2 coeffile=$coeffile2 \
	vp1=$vp1 vs1=$vs1 rho1=$rho1 \
	delta1=$delta1 eps1=$eps1 axis1=$axis1 \
	vp2=$vp2 vs2=$vs2 rho2=$rho2 \
	delta2=$delta2 eps2=$eps2 axis2=$axis2 

n2=`cat $outpar2`

xgraph <$coeffile2 n=$n2  \
        width=$width height=$height \
        d1num=$d1num d2num=$d2num\
        linewidth=$linewidth marksize=$marksize \
        label1=$label1 label2=$label2 linecolor=3 \
        style=$style title="Honoring Anisotropy" &

#merge the curves 
linecolor=2,3
cat $coeffile1 $coeffile2 |
xgraph  n=$n1,$n2  linecolor=$linecolor\
        width=$width height=$height \
        d1num=$d1num d2num=$d2num\
        linewidth=$linewidth marksize=$marksize \
        label1=$label1 label2=$label2 \
        style=$style title="Comparison" &

# clean up

#/bin/rm $coeffile1 $coeffile2 $outpar1 $outpar2

exit



